package com.mobi.Survey.map;

import android.app.Activity;
import android.app.Dialog;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;

public class CheckGooglePlayService {

	private final static int CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000;

	public boolean servicesConnected(Activity ctx) {

		int resultCode = GooglePlayServicesUtil
				.isGooglePlayServicesAvailable(ctx);

		if (ConnectionResult.SUCCESS == resultCode) {

			return true;

		} else {

			Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
					resultCode, ctx, CONNECTION_FAILURE_RESOLUTION_REQUEST);

			errorDialog.show();

		}
		return false;
	}

}